package com.zyf.project.kvdb.protocol.proto.wal.impl;

import com.zyf.project.kvdb.protocol.proto.wal.Entity;
import com.zyf.project.kvdb.protocol.proto.wal.KV;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

/**
 * @author Zhou Yifan
 */
public class WalEntity implements Entity {

    private final KV[] kvs;

    public WalEntity(KV[] kvs) {
        this.kvs = kvs;
    }

    /**
     * 获取键值对
     *
     * @return {@link KV} 数组
     */
    @Override
    public KV[] getKVs() {
        return kvs;
    }

    @Contract(value = "_ -> new", pure = true)
    public static @NotNull WalEntity newPutEntity(KV... kvs) {
        return new WalEntity(kvs);
    }

}
